﻿using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
using Newtonsoft.Json;

namespace TradeMeSDK
{
    public class JsonParser
    {
        public static T Parse<T>(string json)
        {
			//var serializer = new DataContractJsonSerializer(typeof(T));
			//using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(json)))
			//{
			//    return (T)serializer.ReadObject(ms);
			//}

            return JsonConvert.DeserializeObject<T>(json);
        }

    }
}
